package com.zklock;

/**
 * Created by yu756 on 2020/4/2 0:30
 */
public class OrderService {
    private OrderNumCreateUtil orderNumCreateUtil = new OrderNumCreateUtil();

    private ZKLock zkLock = new ZkDistributedLock();

    public void getOrderNumber() {
        zkLock.zklock();
        try {
            System.out.println("----->:" + orderNumCreateUtil.getOrderNumber());
        }catch (Exception e){

        }finally {
            zkLock.zkUnlock();
        }

    }

}
